﻿var c_allyes_text = {};
var c_allyes_delay = 1000;
Ctrip.module.allyes = function(g) {
    var h = j("user") || j("mod_allyes_user");
    if (!h) {
        var i = j('mod_allyes_buttons', window);
        var o = j('mod_allyes_text', window.c_allyes_text);
        if (!i && !o) return
    }
    var r = '<div class="base_ad140x60" style="height:{$height}px">{$iframe}<\/div>';
    var t = '<div class="base_adtxt140">{$text}<\/div>';
    var A = '<iframe marginheight="0" width="100%" height="100%" marginwidth="0" frameborder="0" scrolling="no" src="http:\/\/allyes.ctrip.com\/main\/adfshow?user={$user}&db=ctrip&border=0&local=yes"><\/iframe>';
    setTimeout(function() {
        if (h) {
            if (h.indexOf('@') > -1) h = y(h.split('@'));
            g.innerHTML = A.replace('{$user}', h)
        } else {
            var a = [];
            if (i) a = i.map(function(b) {
                b.button = b.button || ';';
                return r.replace('{$height}', b.height).replace('{$iframe}', A.replace('{$user}', b.user))
            });
            if (o) a.push(t.replace('{$text}', $s2t(o)));
            g.innerHTML = a.join('')
        }
    },
    window.c_allyes_delay);
    function j(a, c) {
        var e = g.getAttribute(a);
        if (!e) return null;
        if (c) return c[e] || null;
        else return e
    }
    function y(a) {
        var c = /^(SearchFlights\.aspx|SearchHotels\.aspx|query\.asp)$/i;
        var e = location.pathname;
        e = e.slice(e.lastIndexOf('/') + 1);
        return c.test(e) ? a[0] : a[1]
    }
};
Ctrip.module.notice = function(a) {
    var c;
    a.module.notice = new
    function() {
        this.enabled = true;
        this.tip = a.getAttribute("mod_notice_tip") || "";
        this.check = function() {
            if (a.module.notice.enabled) {
                with(a) {
                    if (isNull()) {
                        style.color = "gray";
                        value = module.notice.tip
                    } else style.color = ""
                }
            }
        };
        this.isNull = a.isNull = function() {
            return a.value.trim() == "" || a.value == a.module.notice.tip
        }
    };
    a.$r("focus",
    function() {
        c = true;
        if (a.module.notice.enabled) {
            a.style.color = "";
            if (a.value == a.module.notice.tip) a.value = ""
        }
    },
    10);
    a.$r("blur",
    function() {
        c = false;
        a.module.notice.check();
        if($("#city_name1").val() != ""){
            TabFoucs(002);
        }else{
            TabFoucs(001);
        }
        // 
    },
    90);
    if (a.form) {
        var e = $getElement(a.form);
        e.$r("submit",
        function() {
            if (a.isNull()) a.value = "";
            setTimeout(function() {
                if (!c) a.module.notice.check()
            },
            1)
        });
        if (!$$.browser.IE) _.$r("beforeunload", a.module.notice.check)
    }
    a.module.notice.check();
};
Ctrip.module.tab = function(h) {
    var i = _.$g(h.getAttribute("mod_tab_button") || "");
    var o = _.$g(h.getAttribute("mod_tab_panel") || "");
    var r = parseInt(h.getAttribute("mod_tab_select") || 1, 10);
    var t = ((h.getAttribute("mod_tab_event") || "").match(/^mouseover$/i) || "click").toString();
    if (!i || !o) return;
    h.module.tab = new
    function() {
        this.funcListHash = {};
        this.select = function(a) {
            if (this.funcListHash[a - 1]) this.funcListHash[a - 1]()
        };
        this.index = r
    };
    i.each(function(e, g) {
        h.module.tab.funcListHash[g] = function() {
            i.each(function(a, c) {
                a.className = a.className.replace(/_(no)?current/g, "_" + (g == c ? "": "no") + "current");
                if (o[c]) o[c].style.display = (g == c) ? "": "none"
            });
            h.module.tab.index = g + 1
        };
        e.$r(t, h.module.tab.funcListHash[g])
    });
    h.module.tab.select(r)
};
Ctrip.module.display = function(o) {
    var r = o.$getPara("mod_display_panel"),
    t = [];
    r.each(function(a) {
        a = _.$getElement(a) || _.$selNode(a);
        if (a) {
            if (a.length) a.each(function(a) {
                t.push(a)
            });
            else t.push(a)
        }
    });
    o.$r("click",
    function() { (function(g) {
            for (var h = 0; h < g.childNodes.length; h++) {
                with(g.childNodes[h]) {
                    if (nodeType == 3) {
                        var i = new RegExp($$.string.display.match(/[^@]+/g).join("|"), "gi");
                        nodeValue = nodeValue.replace(i,
                        function(a) {
                            var c = new RegExp("@" + a + "\\|([^@]+)|([^@]+)\\|" + a + "@", "i");
                            var e = $$.string.display.match(c);
                            return e[1] || e[2]
                        })
                    } else arguments.callee(g.childNodes[h])
                }
            }
        })(o);
        t.each(function(a) {
            a.style.display = a.$getStyle("display") == "none" ? "": "none"
        })
    })
};
Ctrip.module.selectAll = function(e) {
    var g = $selNode(e.getAttribute("mod_selectAll_input") || "");
    if (!g) return;
    g.each(function(c) {
        if (c != e) c.$r("onclick",
        function() {
            e.checked = g.each(function(a) {
                if (a != e && !a.checked) return false
            })
        })
    });
    e.$r("click",
    function() {
        g.each(function(a) {
            a.checked = e.checked
        })
    })
};
Ctrip.module.validate = function(a) {
    var c = _.$getElement(a.getAttribute("mod_validate_true") || "");
    var e = _.$getElement(a.getAttribute("mod_validate_false") || "");
    var g = a.getAttribute("mod_validate_function") || "";
    if (!g) return;
    var h = g.match(/^\/(.*?[^\\])\/([gmi]*?)$/);
    var i, o, r;
    g = a[g] || _[g];
    if (h || g) {
        a.module.validate = new
        function() {
            this.check = function() {
                if (a.value || !c && !e) r = !(o = g ? g(a.value, a) : a.value.match(new RegExp(h[1], h[2])));
                else o = r = false;
                if (c) c.style.display = o ? "": "none";
                if (e) e.style.display = r ? "": "none"
            }
        };
        a.$r("focus",
        function() {
            i = setInterval(a.module.validate.check, 200)
        });
        a.$r("blur",
        function() {
            a.module.validate.check();
            clearInterval(i)
        })
    }
};
$$.module.jmpInfo = {
    timers: {
        show: 300,
        hide: 150,
        refresh: 200
    },
    container: $getElement("tuna_jmpinfo") || $getElement('z1'),
    template: {},
    array: {},
    load_timeout: 3000,
    template_dir: $webresourceUrl('/code/js/resource/jmpinfo_tuna/'),
    data_dir: $webresourceUrl('/code/js/resource/jmpinfo_tuna/'),
    ready: 0
}; (function(q) {
    var z, w, I = {},
    D, G;
    var L = {
        'align-center': 'ctcb',
        'align-left': 'ltlb',
        'corner-left': 'ltrb',
        'align-right': 'rtrb',
        'corner-right': 'rtlb',
        'above-align-left': 'lblt',
        'above-align-right': 'rbrt'
    };
    function M(a) {
        this.direct = {
            't': (/(.)t\1b/),
            'r': (/r(.)l\1/),
            'b': (/(.)b\1t/),
            'l': (/l(.)r\1/)
        };
        this.setInfo(a)
    }
    M.prototype = {
        show: function() {
            if (!this.ckStatus()) {
                setTimeout(arguments.callee.bind(this), q.timers.refresh);
                return
            } else {
                q.ready = 1;
                if (G) J(G)
            }
            var a = q.container;
            this.fillHtml(a, this.toHtml());
            this.setPosition(a, this.elem, this.position);
            this.setIframe();
            this.countDownHide();
            if ($type(this.callback) === 'function') {
                this.callback.call(null, 'show', this.elem, this)
            }
        },
        ckStatus: function() {
            var a = this.query ? !!q.array[this.query.name] : true;
            return !! q.template[this.page] && a
        },
        hide: function() {
            J(q.container);
            w = null;
            this.clearIframe();
            if ($type(this.callback) === 'function') {
                this.callback.call(null, 'hide', this.elem, this)
            }
        },
        setIframe: function() {
            var a = this.box || q.container;
            G = a.$setIframe()
        },
        clearIframe: function() {
            var a = this.box || q.container;
            a.$clearIframe();
            G = null
        },
        setPosition: function(a, c, e) {
            K(a);
            if (! (e && e.length == 2)) {
                e = this.exchangeDirction(a, c)
            }
            this.setPos(a, c, e)
        },
        setPos: function(a, c, e) {
            if (this.arrow) {
                this.exchangeClass(a, c, e.join(""))
            }
            a.$setPos.apply(a, [c].concat(e))
        },
        exchangeDirction: function(a, c) {
            var e = c.$getPos();
            var g = this.view();
            var h = {
                x: c.offsetWidth,
                y: c.offsetHeight
            };
            var i = {
                x: a.offsetWidth,
                y: a.offsetHeight
            };
            var o = ['l', 't', 'l', 'b'];
            if (e[0] + i.x > g.right && e[0] + h.x - i.x >= g.left) {
                o[0] = 'r';
                o[2] = 'r'
            }
            if (e[1] + h.y + i.y > g.bottom && e[1] - i.y >= g.top) {
                o[1] = 'b';
                o[3] = 't'
            }
            return [o.slice(0, -2).join(""), o.slice(2).join("")]
        },
        view: function() {
            var a = $pageSize('win');
            a.right = a.left + a.width;
            a.bottom = a.top + a.height;
            return a
        },
        fillHtml: function(a, c) {
            a.innerHTML = c;
            $parserRe(a);
            this.initElements()
        },
        initElements: function() {
            var a = q.container.$g(".base_jmp");
            this.box = a ? a[0] : q.container;
            var c = q.container.$getElement("b");
            this.arrow = c ? c[0] : null;
            a = c = null
        },
        exchangeClass: function(a, c, e) {
            for (k in this.direct) {
                var g = e.match(this.direct[k]);
                if (g) {
                    this.box.className = this.box.className.replace(/[trbl]$/, k);
                    this.arrow.className = this.arrow.className.replace(/[trbl]$/, k);
                    this.calculateArrow(a, c, k, g[1]);
                    return
                }
            }
            throw ('This direction of jmpInfo is not support yet!');
        },
        calculateArrow: function(a, c, e, g) {
            if ('tb'.indexOf(e) >= 0) {
                var h = a.offsetWidth,
                i = c.offsetWidth,
                o = this.arrow.offsetWidth;
                if (g === 'l') {
                    this.arrow.style.left = (Math.min(h, i) - o) / 2 + "px"
                } else if (g === 'r') {
                    this.arrow.style.right = (Math.min(h, i) - o) / 2 + "px"
                } else if (g === 'c') {
                    this.arrow.style.left = (Math.max(h, i) - o) / 2 + "px"
                }
            }
        },
        getInfo: function() {},
        setInfo: function(a) {
            this.elem = a;
            var c = (a.getAttribute('mod_jmpInfo_page') || 'default_normal').split('?');
            this.page = !(/^#/).test(c[0]) ? c[0].replace(/\.asp$/i, '').toLowerCase() : c[0];
            this.query = this.parseQuery(c.slice(1).join(''));
            this.ready = Math.min(this.loadData(this.query), this.loadTemplate(this.page));
            var e = a.getAttribute('mod_jmpInfo_content') || '';
            this.content = e.split('|');
            var g = a.getAttribute('mod_jmpInfo_position') || 'auto';
            if (g in L) g = L[g];
            this.position = g.match(/[ltrbc]{2}/ig);
            var h = a.getAttribute('mod_jmpInfo_callback');
            if (h && $type(_[h]) === 'function') this.callback = _[h];
            return this
        },
        toHtml: function() {
            var a = q.template[this.page];
            var c = a.match(/<body.*?>([\s\S]+)<\/body>/i);
            a = (c ? c[1] : a).replace(/<!--[\s\S]*?-->/g, '');
            var e = {
                'para': this.content
            };
            if (this.query) e['array'] = this.queryData(this.query);
            return this.fillContent(a, e)
        },
        parseQuery: function(a) {
            if (!a) return null;
            var c = a.split('=');
            if (c.length < 2) return null;
            return {
                name: c[0],
                value: c.slice(1).join('')
            }
        },
        loadData: function(c) {
            if (!c) return true;
            var e = c.name;
            var g = q.array;
            if (g.hasOwnProperty(e)) return !! g[e];
            g[e] = false;
            var h = q.data_dir + e + '_' + $$.status.charset + '.js';
            $loadJs(h, null,
            function(a) {
                if (a) return true
            },
            q.load_timeout);
            return false
        },
        loadTemplate: function(c) {
            var e = q.template;
            if (e.hasOwnProperty(c)) return !! e[c];
            e[c] = false;
            if (c.charAt(0) === '#') {
                var g = __.$g(c);
                if (g) {
                    e[c] = this.htmlOf(g[0]);
                    return true
                }
            } else {
                var h = q.template_dir + c + '.js';
                $loadJs(h, 'gbk',
                function(a) {
                    if (a) return true
                },
                q.load_timeout)
            }
            return false
        },
        htmlOf: function(a) {
            if (!a || a.nodeType != 1) return '';
            a = a.cloneNode(true);
            a.removeAttribute('id');
            a.style.cssText = a.style.cssText.replace(/\bdisplay:\s*none;?/i, '');
            if ('outerHTML' in a) {
                return a.outerHTML.replace(/(<[^>]+\sid=)(\w+)/g, '$1"$2"')
            } else {
                var c = [];
                var e = a.attributes;
                for (var g = 0; g < e.length; g++) {
                    if (e[g].name == 'id') continue;
                    c.push(e[g].name + '="' + e[g].value + '"')
                }
                var h = c.length ? ' ' + c.join(' ') : '';
                var i = a.tagName.toLowerCase();
                return '<' + i + h + '>' + a.innerHTML + '</' + i + '>'
            }
        },
        fillContent: function(r, t) {
            var A = $keys(t).join('|');
            var j = '(<(\\w+)[^>]*)\\bid="(' + A + ')(\\d+)"([^>]*>)[\\s\\S]*?(<\\/\\2>)';
            var y = new RegExp(j, 'gi');
            return r.replace(y,
            function(a, c, e, g, h, i, o) {
                return c + i + (t[g][h - 1] || '') + o
            })
        },
        countDownHide: function() {
            var a = this;
            var c = setInterval(function() {
                if (w && $contains(w, D) || $contains(q.container, D)) return;
                a.hide();
                clearInterval(c)
            },
            q.timers.hide)
        },
        queryData: function(a) {
            var c = q.array[a.name];
            var e = '@' + a.value + '|';
            var g = c.indexOf(e) + 1;
            if (!g) {
                return []
            }
            return c.slice(g, c.indexOf('@', g)).split('|')
        }
    };
    function J(a) {
        a.style.display = "none"
    }
    function K(a) {
        a.style.display = ""
    }
    function s(a, c) {
        a.style.visibility = c ? "": "hidden"
    }
    function B(a) {
        if (z) clearTimeout(z);
        z = setTimeout(function() {
            if (! (w && $contains(w, D))) return;
            C(a)
        },
        q.timers.show)
    }
    function E(a, c) {
        var e = I[c];
        if (e) {
            e.setInfo(a)
        } else {
            switch (c) {
            case "jmpinfo":
                e = new M(a);
                break;
            default:
                throw ("No this type jmpinfo yet!");
                break
            }
        }
        return e
    }
    function C(a) {
        var c = a.getAttribute("mod"),
        e = E(a, 'jmpinfo');
        e.show()
    }
    function W(a) {
        var c = D = $fixE(a).$target;
        var e = n(c);
        if (e) {
            if (w && $contains(w, c)) return;
            B(e);
            w = e
        } else {
            w = null
        }
    }
    function n(a) {
        while (!Ctrip.support.isMod(a, "jmpinfo") && ___ != a) {
            a = a.parentNode
        }
        return a == ___ ? null: $getElement(a)
    }
    function bi() {
        s(q.container, true);
        ___.$r('mouseover', W)
    }
    _.$r("domready", bi)
})($$.module.jmpInfo);
$r('domReady',
function() {
    var a = '.tuna_calendar{width:362px;font-size:12px;font-family:tahoma, Arial, Helvetica, simsun, sans-serif;position:absolute;z-index:1000;background-color:#fff;border:solid 1px #47ADF3;-moz-box-shadow:3px 4px 5px #ccc;-webkit-box-shadow:3px 4px 5px #ccc;box-shadow:3px 4px 5px #ccc;margin:0;padding:5px 6px 4px}.tuna_calendar .select_day,.tuna_calendar dd a:hover,.tuna_calendar .calendar_title01 a,.tuna_calendar .calendar_title02 a{background:#FFF url({$picserver}/common/un_bg_calender.png) no-repeat}.tuna_calendar a{color:#005ead;font-weight:bold;text-decoration:none!important}.tuna_calendar dl{float:left;width:175px;padding:6px 0 0}.tuna_calendar #calendar_month2{position:absolute;top:28px;left:186px;z-index:2;padding-bottom:5px;padding-left:6px;border-left:2px solid #999}.tuna_calendar dt{float:left;width:25px;height:22px;background:#ececec;font-weight:normal;color:#666;font-size:12px;line-height:20px;text-align:center;cursor:default}.tuna_calendar .day0,.tuna_calendar .day6{color:#f90;font-weight:bold}.tuna_calendar .day6{width:24px}.tuna_calendar dd{clear:both;padding-top:1px;display:inline-block}.tuna_calendar dd a{font-size:11px;text-align:center;height:24px;width:22px;line-height:24px;float:left;outline-width:0;background-color:#fff;padding:0 2px 1px 1px}.tuna_calendar dd a:hover{background-color:#fff;background-position:-26px -48px}.tuna_calendar .today{font-weight:bold;color:#0053aa;line-height:17px;background-color:#fff5d1;background-image:none;width:17px;height:17px;margin-right:1px;margin-bottom:1px;border:solid 2px #ffe4a9;padding:2px 1px 1px 2px}.tuna_calendar .today:hover{line-height:25px;width:25px;height:25px;border-width:0;margin:0;padding:0}.tuna_calendar .select_day,.tuna_calendar .select_day:hover{color:#fff;background-color:#629be0;background-position:0 -48px}.tuna_calendar .blank_day,.tuna_calendar .over_day{color:#dbdbdb;font-weight:normal;cursor:default}.tuna_calendar .blank_day:hover,.tuna_calendar .over_day:hover{background-color:#fff;background-image:none}.tuna_calendar div{float:left;width:181px;color:#fff;font-weight:bold;height:23px;background:#004fb8}.tuna_calendar div a{cursor:pointer;width:40px;line-height:20px}.tuna_calendar .calendar_title01 label,.tuna_calendar .calendar_title02 label{float:left;width:143px;text-align:center;line-height:23px}.tuna_calendar .calendar_title01 label{padding-right:14px}.tuna_calendar .calendar_title02 label{padding-left:14px}.tuna_calendar .calendar_title01 a,.tuna_calendar .calendar_title02 a{background-color:#2d7fdd;float:left;width:23px;height:23px;overflow:hidden;text-indent:-10em}.tuna_calendar .calendar_title01 a{float:left}.tuna_calendar .calendar_title02 a{background-position:right 0;float:right}.tuna_calendar .calendar_title01 a:hover{background-color:#4895ec;background-position:0 -24px}.tuna_calendar .calendar_title02 a:hover{background-color:#4895ec;background-position:right -24px}.tuna_calendar b,.tuna_calendar i{background-color:#fff;display:block;width:372px;height:1px;border-right:1px solid #c3c3c3;border-left:1px solid #c3c3c3;overflow:hidden;position:absolute;left:0;z-index:1}.tuna_calendar i{border-top:1px solid #999;top:-2px}.tuna_calendar b{border-bottom:1px solid #999;bottom:-2px;_p:-3px}address_hot li,.address_hot_abb,.address_hot_adress{list-style:none;margin:0;padding:0}.address_hot_adress a{text-decoration:none}#tuna_address{font-size:12px;font-family:Arial, Simsun}#tuna_address #address_warp{width:252px;border:1px solid #C0C0C0;background:#FFF;text-align:left;margin:0;padding:0 0 4px}* html #tuna_address #address_warp{}#tuna_address #address_message{display:block;line-height:20px;font-family:Simyou;word-wrap:break-word;word-break:break-all;background-color:#C0C0C0;color:#fff;width:auto;border:none;padding:2px 0 2px 9px}#tuna_address #address_list{margin:0;padding:0}* html #tuna_address #address_list{}#tuna_address #address_list span{width:110px;white-space:nowrap;overflow:hidden;float:right;text-align:right;font:normal 10px/22px verdana;margin:0;padding:0}#tuna_address #address_list a{height:22px;border-top:1px solid #FFF;border-bottom:1px solid #FFF;cursor:pointer;line-height:22px;color:#333;display:block;text-decoration:none;min-height:22px;text-align:left;overflow:hidden;padding:1px 9px 0}* html #tuna_address #address_list a{height:22px}#tuna_address #address_list a:hover{background:#E8F4FF;border-top:1px solid #C0C0C0;border-bottom:1px solid #C0C0C0}#tuna_address .address_selected{background:#EDF5FF;color:#FFF;height:22px}#tuna_address .address_pagebreak{display:none;line-height:25px;text-align:center;margin:0;padding:0}#tuna_address .address_pagebreak a{color:#333;font-family:Arial, Simsun, sans-serif;text-decoration:underline;font-size:14px;margin:0;padding:0 4px}#tuna_address #address_arrowl,#tuna_address #address_arrowr{color:#333}#tuna_address a.address_current{color:#000;text-decoration:none}.address_hot{background-color:#fff;width:283px;font-size:12px;}.address_hotcity{padding-left:10px;height:24px;line-height:24px;color:#cee3fc;border:#2c7ecf solid 1px;background-color:#47ADF3;border-width:1px 1px 0}.address_hotcity strong{color:#fff}.address_hotlist{border:#47ADF3 solid 1px;overflow:hidden;border-width:0 1px 1px;padding:5px; _padding-bottom:30px;}.address_hot_abb{border-bottom:#5da9e2 solid 1px;height:20px}.address_hot_abb li{float:left;width:88px;height:20px;line-height:20px;text-align:center;list-style-type:none;color:#005daa;position:relative;zoom:1;cursor:pointer}.address_hot_abb li .hot_selected{width:88px;border:#5da9e2 solid 1px;position:absolute;left:0;background-color:#fff;color:#000;font-weight:bold;border-width:1px 1px 0}.address_hot_adress{padding-top:4px}.address_hot_adress li{float:left;width:67px;height:24px;overflow:hidden}.address_hot_adress li a{display:block;height:22px;line-height:22px;border:#fff solid 1px;padding-left:5px;color:#000}.address_hot_adress li a:hover{background-color:#e8f4ff;border:#acccef solid 1px;text-decoration:none}'.replaceWith({
        'picserver': $picUrl('')
    });
    if ($$.browser.IE) {
        var c = document.createStyleSheet();
        c.cssText = a
    } else {
        var c = document.createElement('style');
        c.type = "text/css";
        c.textContent = a;
        document.getElementsByTagName('head')[0].appendChild(c)
    }
});
$$.string.address = {
    "zh-cn": {
        b: "输入中文/拼音或↑↓选择.",
        i: "输入",
        j: "或↑↓选择.",
        k: "中文/拼音",
        e: "请输入至少两个字母或一个汉字.",
        h: "",
        o: "按拼音排序",
        s: "对不起, 不支持: ",
        l: "结果共",
        p: "项,←→翻页",
        a: ",共"
    },
    "zh-tw": {
        b: "輸入中文/拼音或↑↓選擇.",
        i: "輸入",
        j: "或↑↓選擇.",
        k: "中文/拼音",
        e: "請輸入至少兩個字母或一個漢字.",
        h: "",
        o: "按拼音排序",
        s: "對不起, 不支持: ",
        l: "結果共",
        p: "項,←→翻頁",
        a: ",共"
    },
    "en": {
        b: "Type or scroll to select.",
        i: "Input ",
        j: " or use up or down to select.",
        k: "English",
        e: "Please Input at least two character.",
        h: "",
        o: "sort by spelling",
        s: "No match",
        l: "Results ",
        p: ",left or right to turn page",
        a: ",All"
    }
} [$$.status.version];
$$.module.address.sourceMap = {
    "hotel": ["http://scriptres.ctrip.com/hoteladdress/HotelCityAddress{$charset}.aspx", "utf-8"],
    "hotelAll": ["http://scriptres.ctrip.com/hoteladdress/HotelCityAddress{$charset}.aspx", "utf-8"]
}; (function() {
    var bj = "_".toString() + "hotData";
    var p = {
        target: null,
        hotTarget: null,
        data: null,
        selectedValue: null,
        hotSelected: '热门',
        tabTagName: 'span',
        tabListTagName: 'ol',
        cityListTagName: 'ul',
        cityTagName: 'span',
        hotData: {},
        hotTemplate: {
            container: '<div class="address_hot" style="display:none;-moz-box-shadow:2px 2px 5px #333;-webkit-box-shadow:2px 2px 5px #333;" id="address_hot">{$text}</div>',
            title: '<div class="address_hotcity"><strong>热门城市</strong>{$text}</div>',
            hotlist: '<div class="address_hotlist">{$text}</div>',
            tags: '<ol class="address_hot_abb" style="{$style}">{$text}</ol>',
            tag: '<li><span {$className}>{$text}</span></li>',
            items: '<ul class="address_hot_adress layoutfix" {$display} type="{$type}">{$text}</ul>',
            item: '<li><a href="###" data="{$data}">{$text}</a></li>'
        },
        hotClassNames: {
            tagSelected: 'hot_selected'
        }
    };
    function bo() {
        if (!bb(arguments[0], arguments[1])) {
            arguments[0].className = arguments[0].className + " " + arguments[1]
        }
    }
    function bp() {
        if (bb(arguments[0], arguments[1])) {
            var a = new RegExp('(\\s|^)' + arguments[1].toReString() + '(\\s|$)');
            arguments[0].className = arguments[0].className.replace(a, ' ').split(" ").join(" ")
        }
    }
    function bb() {
        return arguments[0].className.match(new RegExp('(\\s|^)' + arguments[1] + '(\\s|$)'))
    }
    function N(a, c) {
        var e = a.match(/^[^\|]+/),
        g = c.match(/^[^\|]+/);
        return e > g ? 1 : (e == g ? 0 : -1)
    }
    function bq() {
        var a = $c("div");
        with(a.style) {
            width = "0px";
            height = "0px"
        }
        a.innerHTML = "<div id=\"tuna_address\" style=\"display:none;position:absolute;z-index:120;overflow:hidden;-moz-box-shadow:2px 2px 5px #333;-webkit-box-shadow:2px 2px 5px #333;\"><div id=\"address_warp\"><div id=\"address_message\">&nbsp;<\/div><div id=\"address_list\"><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"###\"><span>&nbsp;<\/span>&nbsp;<\/a><\/div><div class=\"address_pagebreak\" id=\"address_p\"><a id=\"address_arrowl\" href=\"javascript:;\" name=\"p\">&lt;-<\/a><a id=\"address_p1\" href=\"javascript:;\" name=\"1\" class=\"address_current\">1<\/a><a id=\"address_p2\" href=\"javascript:;\" name=\"2\">2<\/a><a id=\"address_p3\" href=\"javascript:;\" name=\"3\">3<\/a><a id=\"address_p4\" href=\"javascript:;\" name=\"4\">4<\/a><a id=\"address_p5\" href=\"javascript:;\" name=\"5\">5<\/a><a id=\"address_arrowr\" href=\"javascript:;\" name=\"n\">-&gt;<\/a><\/div><\/div><\/div>";
        $getElement("jsContainer").appendChild(a);
        x = $getElement("tuna_address");
        $$.module.address.source["default"] = "@@";
        bc = $getElement("address_warp");
        O = $getElement('address_message');
        S = $getElement('address_list');
        P = [$getElement('address_p'), $getElement('address_p1'), $getElement('address_p2'), $getElement('address_p3'), $getElement('address_p4'), $getElement('address_p5')];
        T = $getElement('address_arrowl');
        U = $getElement('address_arrowr');
        v = S.getElementsByTagName("a");
        bk = [];
        for (var c = 0; c < v.length; c++) bk[c] = v[c].cloneNode(true)
    }
    function br(a) {
        var c = p.hotTarget || x;
        bd++;
        if (be) clearTimeout(be);
        be = setTimeout(function() {
            bd = 0
        },
        1);
        if (bd % 2) {
            c.$setPos(a)
        }
    }
    var x, bc, O, S, P, T, U, v, bk, bf = 0,
    bd = 0,
    be;
    Ctrip.module.address = function(j) {
        function y() {
            var a = [];
            for (var c in p.hotData) {
                bf++;
                a.push(p.hotTemplate.tag.replaceWith({
                    text: c,
                    className: $s2t(j.hotSelected) == c ? "class=" + p.hotClassNames.tagSelected: ''
                }))
            }
            return a.join('')
        }
        function q() {
            var g = [];
            for (var h in p.hotData) {
                var i = [];
                var o = p.hotData[h];
                i = o.replace(/@([^@]*)\|([^@]*)/g,
                function(a, c, e) {
                    return p.hotTemplate.item.replaceWith({
                        data: [c, e].join("|"),
                        text: e
                    })
                });
                g.push(p.hotTemplate.items.replaceWith({
                    text: i,
                    display: $s2t(j.hotSelected) == $s2t(h) ? "": "style='display:none'",
                    type: h
                }))
            }
            return g.join('')
        }
        function z() {
            s.style.position = "absolute";
            s.$setPos(K)
        }
        function w() {
            var a = s.getElementsByTagName(p.cityListTagName);
            for (var c = 0; c < a.length; c++) {
                if (a[c].style.display == "") {
                    return a[c]
                }
            }
        }
        function I(a) {
            var c = s.getElementsByTagName(p.cityListTagName);
            for (var e = 0; e < c.length; e++) {
                if (c[e].getAttribute('type') == a) {
                    return c[e]
                }
            }
        }
        function D(a) {
            var c = a.getElementsByTagName(p.cityTagName);
            for (var e = 0; e < c.length; e++) {
                if (bb(c[e], p.hotClassNames.tagSelected)) {
                    return c[e]
                }
            }
        }
        function G(a, c) {
            var e = w();
            if (a && e) {
                w().style.display = "none";
                j.hotSelected = c.innerText || c.textContent;
                I($s2t(j.hotSelected)).style.display = "";
                bp(D(a), p.hotClassNames.tagSelected);
                var g = c.tagName == p.cityTagName.toUpperCase() ? c: c.getElementsByTagName(p.cityTagName)[0];
                bo(g, p.hotClassNames.tagSelected)
            }
        }
        function L(a, c) {
            clearInterval(V);
            selectedValue = c.$target.getAttribute('data').split('|');
            focusTarget.value = selectedValue[1].trim();
            var e = focusTarget.getAttribute('mod_address_reference');
            if (e && $getElement(e)) {
                $getElement(e).value = selectedValue[0].trim();
                if (n.hook["change"]) n.hook["change"]($getElement(j))
            }
            B = 0;
            s.$clearIframe();
            s.style.display = "none";
            j.blur();
            setTimeout(function() {
                if (n.focusNext) setTimeout(function() {
                    j.$focusNext()
                },
                1)
            },
            0)
        }
        function M() {
            s.onmousedown = function(a) {
                a = $fixE(a);
                var c = a.$target;
                p.olObj = c.$parentNode(p.tabListTagName);
                p.ulObj = c.$parentNode(p.cityListTagName);
                if (p.olObj) {
                    G(p.olObj, c)
                } else if (p.ulObj) {
                    L(p.ulObj, a);
                    return
                } else {
                    focusTarget.select()
                }
                $stopEvent(a, 2);
                if ($$.browser.IE) {
                    c.outerHTML += ""
                }
            }
        }
        function J() {
            p.hotData = $$.module.address.source[n.source + bj];
            if (!p.hotData) return;
            K = j;
            j.select();
            if (!j.hotSelected) {
                j.hotSelected = p.hotSelected
            }
            var a = $getElement("address_hot");
            if (a) {
                a.parentNode.removeChild(a)
            }
            var c = p.hotTemplate.container.replaceWith({
                text: [p.hotTemplate.title.replaceWith({
                    text: $$.module.address.source[n.source + "_q"] || " （可直接输入城市或城市拼音）"
                }), p.hotTemplate.hotlist.replaceWith({
                    text: [p.hotTemplate.tags.replaceWith({
                        text: y(),
                        style: bf > 1 ? "": 'display:none;'
                    }), q()].join('')
                })].join('')
            });
            var e = $c('div');
            e.innerHTML = c;
            s = $getElement(e.removeChild(e.firstChild));
            __.body.appendChild(s);
            s.style.display = '';
            s.style.zIndex = 111;
            z();
            s.$setIframe();
            M();
            bf = 0
        }
        var K, s;
        var B = 0,
        E, C = j.$getWin(),
        W = 0;
        var n = j.module.address = {};
        var bi, V, u = null,
        X, Q = [];
        var R = false;
        n.ver = j.getAttribute('mod_address_ver');
        if (!x) {
            bq();
            _.$r("resize",
            function() {
                br(j)
            })
        }
        j.setAttribute("autoComplete", "off");
        $r("beforeunload",
        function() {
            j.setAttribute("autoComplete", "on")
        });
        n.focusNext = j.getAttribute("mod_address_focusNext");
        n.focusNext = /^(1|true)$/i.test(n.focusNext || "");
        n.reference = j.getAttribute("mod_address_reference");
        var H = j.getAttribute("mod_address_cookie");
        if (H) {
            H = C.$getElement(H);
            if (!H) {
                var bl = C.$c("input");
                with(bl) {
                    type = "hidden";
                    id = name = H
                }
                H = bl;
                j.parentNode.insertBefore(H, j)
            }
        }
        if (n.reference) n.reference = C.$getElement(n.reference) || C.$getElement(n.reference, true);
        var Y = j.getAttribute("mod_address_suggest");
        var bm = j.getAttribute("mod_address_cookieSuggest");
        n.suggest = [];
        if (bm) {
            n.suggest = bm.match(/[^@]+@/gi);
            if (Y) n.suggest._r(Y.match(/[^@]+@/gi))
        } else if (Y) n.suggest = Y.match(/[^@]+@/gi);
        if (n.suggest.length > 12) n.suggest = n.suggest.slice(0, 12);
        n.source = j.getAttribute("mod_address_source") || "default";
        if (!$$.module.address.source[n.source]) {
            $$.module.address.source[n.source] = "@@";
            if ($$.module.address.sourceMap[n.source]) $loadJs($$.module.address.sourceMap[n.source][0].replace(/\{\$charset\}/gi, $$.status.charset), ($$.module.address.sourceMap[n.source][1] || "").replace(/\{\$charset\}/gi, $$.status.charset) || $$.status.charset);
            else $loadJs($webresourceUrl("/images/") + n.source + "_" + $$.status.charset + ".js", $$.status.charset)
        }
        n.auto = j.getAttribute("mod_address_auto");
        n.auto = n.auto && n.auto.match(/^(false|0)$/i) ? false: true;
        n.redraw = function() {
            if (V) bg()
        };
        n.hook = {}; (j.getAttribute("mod_address_hook") || "").replace(/(on)?([^;:]+):([^;]+)/gi,
        function(a, c, e, g) {
            n.hook[e.toLowerCase()] = C[g]
        });
        function bs() {
            R = true;
            if (B) {
                B = 0;
                return
            }
            E = false;
            S.style.display = O.style.display = P[0].style.display = "none";
            function e(c) {
                v[c].onmousedown = function(a) {
                    Z(c);
                    $stopEvent(a);
                    if (v[c].outerHTML) v[c].outerHTML = v[c].outerHTML + ' ';
                    j.blur()
                }
            }
            x.onmousedown = function(a) {
                setTimeout(function() {
                    R = false
                },
                200);
                B = 1;
                a = a || window.event;
                $stopEvent(a);
                return false
            };
            for (var g = 0; g < v.length; g++) new e(g);
            T.onmousedown = U.onmousedown = ba;
            for (var g = 1; g < P.length; g++) P[g].onmousedown = ba;
            X = null;
            if (u !== null) {
                v[u].className = "address_selected"
            }
            if (n.hook["focus"]) {
                n.hook["focus"](j)
            }
            bg();
            V = setInterval(bg, 150)
        }
        function ba(a) {
            B = 1;
            if (a) $stopEvent(a);
            switch (this) {
            case T:
                F.m_get(F.page - 1);
                break;
            case U:
                F.m_get(F.page + 1);
                break;
            default:
                F.m_get(parseInt(this.firstChild.nodeValue))
            }
            return false
        }
        var F = new
        function() {
            var h;
            this.page = 1;
            this.pagelist;
            this.maxpage = 1;
            this.m_get = function(a) {
                if (!h || !a || a < 1 || a > this.maxpage) return null;
                this.page = a;
                this.pagelist = h.slice((a - 1) * 12, Math.min(a * 12, h.length));
                for (var c = 0; c < v.length; c++) {
                    if (c < this.pagelist.length) {
                        v[c].style.display = "block";
                        var e = this.pagelist[c].replace(/@/g, "").split("|");
                        v[c].lastChild.nodeValue = e[1];
                        v[c].firstChild.firstChild.nodeValue = e[0];
                        Q[c] = e
                    } else {
                        v[c].style.display = "none";
                        Q[c] = null
                    }
                }
                if (u !== null) {
                    if (u >= this.pagelist.length) {
                        v[u].className = "";
                        u = this.pagelist.length - 1;
                        v[u].className = "address_selected"
                    }
                } else {
                    u = 0;
                    v[0].className = "address_selected"
                }
                i.call(this);
                S.style.display = O.style.display = "";
                if (!E) {
                    x.style.display = "";
                    var g = j.$getPos();
                    if (x.offsetWidth + g[0] > ___.offsetWidth) x.$setPos(j, "tr", "br");
                    else x.$setPos(j);
                    x.$setIframe();
                    E = true
                }
                bh.call(this)
            };
            this.m_set = function(a) {
                h = a;
                this.maxpage = Math.ceil(a.length / 12);
                this.page = 1;
                this.m_get(1)
            };
            function i() {
                var a = this.maxpage < 6 || this.page < 3 ? 1 : this.page > this.maxpage - 2 ? this.maxpage - 4 : this.page - 2;
                var c = Math.min(a + 4, this.maxpage);
                var e;
                T.style.display = this.page == 1 ? "none": "";
                U.style.display = this.page == this.maxpage ? "none": "";
                for (var g = a; g < a + 5; g++) {
                    e = P[g - a + 1];
                    if (g <= c) {
                        e.firstChild.nodeValue = g;
                        e.className = g == this.page ? "address_current": "";
                        e.style.display = ""
                    } else e.style.display = "none"
                }
                P[0].style.display = this.maxpage > 1 ? "block": "none"
            }
        };
        function bh() {
            with(x.style) {
                width = bc.offsetWidth + "px";
                height = bc.offsetHeight + "px"
            }
            x.$setIframe()
        }
        function bn() {
            if (n.suggest.length == 0) {
                x.style.display = "none";
                if (u !== null) {
                    v[u].className = "";
                    u = null
                }
                return
            }
            F.m_set(n.suggest);
            O.lastChild.nodeValue = $$.status.version.match(/^zh-/) ? $$.string.address.i + (j.module.notice ? j.module.notice.tip: $$.string.address.k) + $$.string.address.j: $$.string.address.b
        }
        function bg() {
            focusTarget = j;
            var c = j.value.trim();
            if (c === X) return;
            X = c;
            c = c.replace(/([\(\)\\\[\]\.\+\?\*\|\^\$])/gi, "\\$1").replace(/@|\|/gi, "");
            if (R && $$.module.address.source[n.source + bj]) {
                J();
                R = false;
                p.hotTarget = s;
                return
            }
            if (s && !s.style.display) {
                p.hotTarget = null;
                s.$clearIframe();
                s.style.display = "none"
            }
            if (!c) {
                bn();
                bh();
                return
            }
            if (s) {
                s.$clearIframe();
                s.style.display = "none"
            }
            x.style.display = "";
            var e = $$.module.address.source[n.source];
            var g = new RegExp("@([^\\|@]*\\|)?" + c + "[^@]*", "gi");
            var h = new RegExp("@([^@]*\\|)?" + c + "[^@]*", "gi");
            var i = new RegExp("@[^@]*" + c + "[^@]*", "gi");
            var o = [],
            r = [],
            t = [];
            e = e.replace(g,
            function(a) {
                o.push(a);
                return ""
            });
            if (o) o.sort(N);
            e = e.replace(h,
            function(a) {
                r.push(a);
                return ""
            });
            if (r) r.sort(N);
            e = e.replace(i,
            function(a) {
                t.push(a);
                return ""
            });
            if (t) t.sort(N);
            arr = o.concat(r).concat(t);
            if (!arr || !arr.length) {
                O.lastChild.nodeValue = n.auto ? ($$.string.address.s + ($$.status.version == "en" ? "": j.value)) : ($$.string.address.h + j.value + ", " + $$.string.address.o);
                if (!n.auto) {
                    x.style.display = "none";
                    if (u !== null) {
                        v[u].className = "";
                        u = null
                    }
                }
                if (S.style.display == "none") bn();
                bh()
            } else {
                O.lastChild.nodeValue = $$.string.address.h + j.value + ", " + $$.string.address.o;
                F.m_set(arr)
            }
            R = false
        }
        function bt(a) {
            var c = a ? a.keyCode: event.charCode;
            var e = "|" + c + "|";
            if (u == null) {
                if ("|13|".indexOf(e) != -1) {
                    $stopEvent(a, 1);
                    if (n.focusNext) setTimeout(function() {
                        j.$focusNext()
                    },
                    1)
                }
                return true
            }
            if ("|13|".indexOf(e) != -1) {
                $stopEvent(a, 1);
                Z(u);
                j.blur()
            }
            if ("|33|37|188|219|".indexOf(e) != -1) {
                ba.call(T);
                $stopEvent(a, 1)
            }
            if ("|34|39|61|190|221|".indexOf(e) != -1) {
                ba.call(U);
                $stopEvent(a, 1)
            }
            if ("|38|40|".indexOf(e) != -1) {
                v[u].className = "";
                u += F.pagelist.length - 39 + c;
                u %= F.pagelist.length;
                v[u].className = "address_selected";
                $stopEvent(a, 1)
            }
        }
        function Z(a, c) {
            B = 2;
            j.value = Q[a][1] || Q[a][0];
            if (n.reference) n.reference.value = Q[a][2];
            if (H) H.value = Q.join("|");
            if (n.hook["change"]) n.hook["change"](j);
            if (c !== false && n.focusNext) setTimeout(function() {
                j.$focusNext()
            },
            1)
        }
        function bu() {
            R = false;
            if (B == 1) {
                setTimeout(function() {
                    j.focus()
                },
                1);
                return
            }
            clearInterval(V);
            V = null;
            if (s) {
                s.$clearIframe();
                s.style.display = "none"
            }
            x.$clearIframe();
            x.style.display = "none";
            if (u !== null) {
                if (j.value && B != 2) {
                    if (n.auto) Z(u, false);
                    else n.check()
                }
                v[u].className = "";
                u = null
            }
            B = 0;
            x.onmousedown = null
        }
        n.check = function() {
            var c = j.value.trim();
            if (j.isNull && j.isNull()) c = "";
            var e;
            X = c;
            c = c.replace(/([\(\)\\\[\]\.\+\?\*\|\^\$])/gi, "\\$1").replace(/@|\|/gi, "");
            if (c) {
                var g = $$.module.address.source[n.source];
                var h = n.auto ? new RegExp("@([^\\|@]*\\|)?" + c + "[^@]*", "gi") : new RegExp("@([^\\|@]*\\|)?" + c + "(\\|[^@]*)?(?=@)", "gi");
                var i = n.auto ? new RegExp("@([^@]*\\|)?" + c + "[^@]*", "gi") : new RegExp("@([^@]*\\|)?" + c + "(\\|[^@]*)?(?=@)", "gi");
                var o = new RegExp("@[^@]*" + c + "[^@]*", "gi");
                var r = [],
                t = [],
                A = [];
                g = g.replace(h,
                function(a) {
                    r.push(a);
                    return ""
                });
                if (r) r.sort(N);
                g = g.replace(i,
                function(a) {
                    t.push(a);
                    return ""
                });
                if (t) t.sort(N);
                if (n.auto) {
                    g = g.replace(o,
                    function(a) {
                        A.push(a);
                        return ""
                    });
                    if (A) A.sort(N)
                }
                e = r.concat(t).concat(A);
                if (e && e.length) {
                    E = true;
                    F.m_set(e);
                    E = false;
                    Z(0, false);
                    B = 0
                }
            }
            if (j.module.notice) j.module.notice.check();
            return !! e
        };
        j.$r("onfocus", bs);
        j.blur();
        j.$r("onblur", bu);
        j.$r("onkeydown", bt);
        if (n.hook["load"]) n.hook["load"](j)
    }
})();
$$.module.calendar = {
    string: {
        "zh-cn": {
            a: "年",
            b: "月",
            weekday: "日一二三四五六",
            f: "yyyy-mm-dd"
        },
        "zh-tw": {
            a: "年",
            b: "月",
            weekday: "日一二三四五六",
            f: "yyyy-mm-dd"
        },
        "en": {
            a: "",
            b: "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec",
            weekday: "SMTWTFS",
            f: "mm-dd-yyyy"
        }
    } [$$.status.version],
    template: '<div class="calendar_title01"><a id="calendar_lastmonth">&lt;--</a><label id="calendar_title1">{$frontMonthStr}</label></div><div class="calendar_title02"><a id="calendar_nextmonth">--&gt;</a><label id="calendar_title2">{$endMonthStr}</label></div><dl id="calendar_month1" t="{$frontMonth}">{$header}<dd>{$frontDay}</dd></dl><dl id="calendar_month2"  t="{$endMonth}">{$header}<dd>{$endDay}</dd></dl><i>&nbsp;</i><b>&nbsp;</b>',
    className: {
        today: "today",
        over: "over_day",
        blank: "blank_day",
        select: "select_day"
    },
    attr: ['mod_calendar_rangeStart', 'mod_calendar_rangeEnd', 'mod_calendar_rangeException', 'mod_calendar_permit', 'mod_calendar_prohibit', 'mod_calendar_weekday', 'mod_calendar_hook', 'mod_calendar_focusNext', 'mod_calendar_reference'],
    init: $doNothing,
    current: null
}; (function(j) {
    var y, q = [],
    z,
    w = false,
    I = 0,
    D;
    function G() {
        var e = j.string.weekday.split("");
        var g = e.map(function(a, c) {
            return '<dt class="day' + c + '">' + a + '</dt>'
        }).join("");
        j.template = j.template.replace(/\{\$header\}/g, g);
        e = g = null
    }
    G.prototype = {
        addCurrentMonth: function(a) {
            var c = this._0._3;
            if (!a) a = 0;
            c.setMonth(c.getMonth() + a);
            return c
        },
        setConfig: function(a) {
            this._1 = j.current = a;
            this._0 = a.$getModAttrs(j.attr);
            this._h()
        },
        handleFocus: function() {
            this._i()
        },
        handleBlur: function() {
            this.hide()
        },
        fresh: function() {
            this._8(true)
        },
        focusNext: function() {
            var a = this;
            if (a._0.focusNext) setTimeout(function() {
                a._1.$focusNext()
            },
            1)
        },
        _h: function() {
            var h = this._1,
            i = this._0,
            o = $$.status.today.isDateTime();
            this._j = new Date(o);
            this._k(h);
            i._3 = C(o);
            i._4 = null;
            if (i.rangeStart) {
                i.rangeStart = i.rangeStart === "#" ? o: i.rangeStart.isDateTime()
            }
            if (i.rangeEnd) {
                i.rangeEnd = i.rangeEnd === "#" ? o: i.rangeEnd.isDateTime()
            }
            i.weekday = i.weekday || "1234567";
            if (i.rangeException) i.rangeException = i.rangeException.split("|");
            if (i.permit) i.permit = i.permit.split("|");
            if (i.prohibit) i.prohibit = i.prohibit.split("|");
            if (i.hook) {
                var r = i.hook;
                i.hook = {};
                r.replace(/(on)?([^;:]+):([^;]+)/gi,
                function(a, c, e, g) {
                    i.hook[e.toLowerCase()] = g
                })
            }
            if (i.focusNext) {
                i.focusNext = (/^(1|true)$/i).test(i.focusNext)
            }
            if (i.reference) {
                i.reference = $getElement(i.reference)
            }
            i.check = this._9;
            i.redraw = $doNothing;
            var t = h.module.calendar;
            for (var A in t) {
                if (A === "hook" && $isEmptyObj(t[A])) continue;
                i[A] = h.module.calendar[A]
            }
            h.module.calendar = i;
            j.current = h;
            h = i = o = t = null
        },
        _k: function(a) {
            a.setAttribute("autoComplete", "off");
            $r("beforeunload",
            function() {
                a.setAttribute("autoComplete", "on")
            })
        },
        _l: function(a, c) {
            var e = a.getFullYear(),
            g = this._0;
            m = a.getMonth(),
            d = 0,
            days = [31, (e % 4 || e % 400 && !e % 100 ? 28 : 29), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
            cls = j.className,
            first = a.getDay(),
            f = false,
            hash = [],
            html = [];
            for (var h = 0; h < 6; h++) {
                hash[h] = [];
                for (var i = 0; i < 7; i++) {
                    while (1) {
                        var o = {
                            n: 0,
                            c: null
                        };
                        d = (h * 7 + i) - first + 1;
                        if (d <= 0 || d > days[m]) {
                            o.c = cls.blank;
                            break
                        }
                        o.n = d;
                        a = new Date(e, m, d);
                        if ( + a === +this._j) {
                            o.c = cls.today
                        }
                        if (!this._9(a)) {
                            o.c = cls.over;
                            break
                        } else {
                            f = true
                        }
                        if ( + a === +g._4 || g.reference && +g.reference.value.isDateTime() === +a) {
                            o.c = cls.select
                        }
                        break
                    }
                    hash[h][i] = o
                }
            }
            if (!f && c) {
                return hash = null
            }
            for (var h = 0; h < 6; h++) {
                for (var i = 0; i < 7; i++) {
                    html.push('<a href="javascript:;" {$cls}>{$d}</a>'.replaceWith({
                        cls: hash[h][i].c ? 'class="' + hash[h][i].c + '"': "",
                        d: hash[h][i].n || "&nbsp;"
                    }))
                }
            }
            return html.join("")
        },
        _9: function(a) {
            var c = this._1,
            e = this._0,
            g;
            if (a) {
                g = a.toStdString()
            } else {
                g = (c.isNull && c.isNull() ? "": c.value.trim());
                a = g.isDateTime();
                if (!a) return false
            }
            if (e.rangeStart && a < e.rangeStart || e.rangeEnd && a > e.rangeEnd) return false;
            if ((e.rangeException && ("|" + e.rangeException.join("|") + "|").indexOf("|" + g + "|") !== -1 || e.prohibit && ("|" + e.prohibit.join("|") + "|").indexOf("|" + g + "|") !== -1 || e.weekday.indexOf(a.getDay() || 7) === -1) && !(e.permit && ("|" + e.permit.join("|") + "|").indexOf("|" + g + "|") === -1)) {
                return false
            }
            return true
        },
        _i: function() {
            var a = this._1.value.isDateTime(),
            c = this._0;
            if (c.reference) {
                var e = c.reference.value.isDateTime();
                if (e && c.rangeStart && e > c.rangeStart) c._3 = C(e)
            }
            if (a) {
                if (c.rangeStart && a > c.rangeStart) c._3 = C(a);
                c._4 = new Date(a)
            } else {
                c._4 = null
            }
            this._8();
            this.show()
        },
        _8: function(a) {
            var c = this._0._3,
            e = this._0.rangeEnd,
            g = [],
            h = [],
            i = l = 0;
            do {
                h[i] = new Date(c.getFullYear(), c.getMonth() + (l++), 1);
                if (e && h[i] >= new Date(e.getFullYear(), e.getMonth(), 1)) a = true;
                var o = this._l(h[i], !a && !i);
                if (o) {
                    g.push(o);
                    i++
                }
            } while ( i <= 1 ) if (l - i) c = new Date(c.setMonth(c.getMonth() + (l - i)));
            z.innerHTML = j.template.replaceWith({
                frontMonthStr: this._a(h[0]),
                endMonthStr: this._a(h[1]),
                frontMonth: this._b(h[0]),
                endMonth: this._b(h[1]),
                frontDay: g[0],
                endDay: g[1]
            })
        },
        _b: function(a) {
            var c = j.string,
            e = a.getMonth(),
            g = a.getFullYear();
            return c.f.replace("yyyy", g).replace("mm", $$.status.version === "en" ? c.b.split("|")[e] : e + 1)
        },
        _a: function(a) {
            if ($$.status.version === "en") {
                return j.string.b.split("|")[a.getMonth()] + "&nbsp;" + a.getFullYear()
            } else {
                return a.getFullYear() + j.string.a + "&nbsp;" + (a.getMonth() + 1) + j.string.b
            }
        },
        show: function() {
            var a = z.style;
            if (a.display) a.display = "";
            z.$setPos(j.current, "auto");
            z.$setIframe()
        },
        hide: function() {
            z.$clearIframe();
            z.style.display = "none";
            j.current = null
        },
        callback: function() {
            var a = this._0.hook && this._0.hook['change'];
            if (!a) return;
            if (Object.prototype.toString.call(a) === "[object String]") {
                var c = a.split(".");
                a = c[0] === "this" ? this._1: _[c[0]];
                for (var e = 1,
                g = c.length; e < g; e++) {
                    if (a[c[e]]) a = a[c[e]];
                    else {
                        throw c.slice(0, e).toString() + "is undefined";
                    }
                }
            }
            a.call(null, this._1)
        },
        handleMousedown: function(a) {
            this._1.value = B(a);
            this._1.blur();
            this.focusNext();
            this.callback()
        }
    };
    function L(a) {
        if (a.$getData("__inited__")) return;
        a.$r("focus", J);
        a.$r("blur", K);
        a.module.calendar = {
            hook: {},
            redraw: $doNothing
        };
        if ($$.browser.IE) {
            a.onbeforedeactivate = function() {
                if (w) {
                    return w = false
                }
                return true
            }
        }
        q.push(a);
        a.$setData("__inited__", 1)
    }
    function M() {
        if (!j.current) return;
        I++;
        if (D) clearTimeout(D);
        D = setTimeout(function() {
            I = 0
        },
        1);
        if (I % 2) {
            y.show()
        }
    }
    function J(a) {
        y.setConfig(this);
        y.handleFocus(a)
    }
    function K(a) {
        y.handleBlur(a)
    }
    function s(a) {
        a.$ur("focus", J);
        a.$ur("blur", K);
        a.module.calendar = null;
        if ($$.browser.IE) {
            a.onbeforedeactivate = null
        }
        q.remove(a);
        a.$removeData("__inited__")
    }
    function B(a) {
        var c = a.innerText || a.textContent,
        e = a.$parentNode("dl");
        if (e) return e.getAttribute("t").replace("dd", c)
    }
    function E(a) {
        y.addCurrentMonth(a);
        y.fresh()
    }
    function C(a) {
        var c = new Date(a);
        c.setDate(1);
        return c
    }
    function W(a) {
        var c = $fixE(a).$target;
        w = true;
        setTimeout(function() {
            w = false
        },
        1);
        $stopEvent(a, 2);
        if (!c || c.nodeName !== "A" || c.className === j.className.blank || c.className === j.className.over) return;
        if (c.id === "calendar_nextmonth") {
            return E(2)
        }
        if (c.id === "calendar_lastmonth") {
            return E( - 2)
        }
        y.handleMousedown(c)
    }
    Ctrip.module.calendar = function(a) {
        if (!y) y = new G();
        L(a);
        if (!z) {
            z = $getElement("tuna_calendar");
            z.$r("mousedown", W);
            _.$r("resize", M)
        }
    }
})($$.module.calendar);
$$.module.loading = {
    source: null,
    backto: null,
    preload: function(a) {
        if (a && $type(a) == 'number') this._c = a;
        this._5.bind(this).delay(this._c)
    },
    show: function() {
        if (this._6) return;
        if (!this._2) this._5();
        if (!this._2) return;
        this._d = maskShow.bgColor;
        this._e.href = this.backto || 'javascript:$$.module.loading.hide()';
        maskShow.bgColor = this._m;
        maskShow.bgColor = '#666';
        maskShow(this._2);
        this._n();
        this._6 = true
    },
    hide: function() {
        if (_.ActiveXObject) __.execCommand('Stop');
        else if (_.stop) _.stop();
        maskShow(null);
        if (this._d) maskShow.bgColor = this._d;
        clearInterval(this._7);
        this._6 = false
    },
    wireup: function(c) {
        if (this._f || !c) return;
        var e = 0;
        _.$getElement(c).$r('submit',
        function() {
            e = new Date()
        },
        1);
        _.$r('beforeunload',
        function() {
            var a = new Date() - e;
            if (a > 0 && a < 1000) $$.module.loading.show()
        },
        1);
        this._f = true
    },
    _g: false,
    _7: null,
    _c: 12000,
    _2: null,
    _e: null,
    _s: null,
    _m: '#666',
    _6: false,
    _f: false,
    _o: ['<div style="background:#FFFFFF none repeat scroll 0%;border:1px solid #CCDCED;height:453px;">', '<h1 style="border-bottom:1px solid #CBDCED;height:85px;margin:0 auto;text-align:center;width:99%"><img src="{$picserver}/common/pic_loading_logo.gif"></h1>', '<div style="width:120px;height:12px;overflow:hidden;margin:80px auto 20px;background-image:url({$picserver}/common/pic_loading_progress.gif)">&nbsp;</div>', '<p style="color:#cc6600;font-size:14px;font-weight:bold;text-align:center">我们正在处理您的请求，请稍候....</p>', '<p style="margin-top:30px"><a style="display:block;width:104px;height:30px;margin:0 auto;background:url({$picserver}/common/btn_loading_cancel.gif) no-repeat 0 0;text-decoration:none;" onmouseover="this.style.backgroundPosition=\'0 -30px\'" onmouseout="this.style.backgroundPosition=\'0 0\'">&nbsp;</a></p>', '<p><a target="_t" href="{$link}"><img style="display:block;margin:0 auto;margin-top:20px;" title="{$title}" alt="{$title}" width="" height="" src="{$img}"></p></div>'].join('').replaceWith({
        'picserver': $picUrl('')
    }),
    _5: function() {
        if (this._2 || !this.source) return;
        var a = this.source.split('@').random().split('|');
        var c = document.createElement('div');
        c.style.cssText = 'width:556px;background:#d9e6f7;border:1px solid #b1cbe4;height:455px;padding:5px;position: absolute; left:-1000px; top:-1000px; z-index: 20;';
        c.innerHTML = this._o.replaceWith({
            img: a[0],
            link: a[1],
            title: a[2] || ''
        });
        $$.status.container.appendChild(c);
        this._2 = c;
        this._e = $getElement(c).$getElement('a')[0]
    },
    _n: function() {
        var c = 0,
        e = 120,
        g = 20,
        h = 300;
        var i = $getElement(this._2).$getElement('div')[1].style;
        clearInterval(this._7);
        var o = new Date(),
        r = -1;
        this._7 = setInterval(function() {
            var a = (Math.floor((new Date() - o) / h) * g) % (e - c) + c;
            if (a != r) {
                r = a;
                i.backgroundPosition = a + 'px 0'
            }
        },
        40)
    }
};
Ctrip.module.loading = function(a) {
    var c = $$.module.loading;
    if (c._g || !(c._g = true)) return;
    var e = a.getAttribute('mod_loading_source');
    if (e) c.source = e;
    var g = a.getAttribute('mod_loading_backto');
    if (g) c.backto = g;
    var h = parseInt(a.getAttribute('mod_loading_preload'));
    if (isNaN(h)) h = null;
    var i = a.getAttribute('mod_loading_sourcescript');
    if (i) $loadJs.pass(i, null, c._5.bind(c)).delay(h || 1);
    else if (h) c.preload(h);
    var o = a.getAttribute('mod_loading_wireup');
    if (o.toLowerCase() == "true") c.wireup(a.tagName == 'FORM' ? a: (a.form || document.aspnetForm))
};
$$.module.adFrame = {
    clock: null,
    list: [],
    interval: 800,
    timeout: 1500,
    count: 0
};
Ctrip.module.adFrame = function(g) {
    var h = $$.module.adFrame;
    function i() {
        var a = h.list.shift();
        var c = a.getAttribute("mod_adFrame_src") || "about:blank";
        var e = a.getAttribute("mod_adFrame_style") || "";
        a.innerHTML = "<iframe marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" scrolling=\"no\" style=\"" + e + "\" src=\"" + c + "\"><\/iframe>";
        if (h.list.length) setTimeout(arguments.callee, h.interval);
        else h.clock = null
    }
    h.list.push(g);
    if (!h.clock) {
        if (h.count) i();
        else h.clock = setTimeout(i, h.timeout)
    }
    h.count++
};
var $jsModuleLoaded = true;